#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Time          : 2023/3/22 17:24
# File          : classs_error.py
# @Author       : MingTai
# @Department   : platform_qa


# 通过自定义异常信息，然后捕获异常进行后续处理
class HelloError(Exception):
    pass


def test_error(msg):
    print(f'传过来的信息= {msg}')


def exception():
    excep = '123456'
    if (1 == 1):
        raise HelloError(f"抛出的异常是 is {excep}")


def align():
    try:
        exception()
    except Exception as ex:
        test_error(ex)


if __name__ == '__main__':
    align()
